﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Script.Serialization;
using RADB;
using System.Collections;

namespace WaiterService
{
    public partial class CancelItem : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            IDataTransfer DTO = (IDataTransfer)Application["DTO"];
            string logedin = Request["logedin"];

            JavaScriptSerializer serializer = (JavaScriptSerializer)Application["serializer"];

            if (logedin != "yes")
                return;

            int waiterID = 0, itemID = 0;

            if (!int.TryParse(Request["ItemID"], out itemID))
                return;

            Hashtable result = new Hashtable();

            result.Add("Success", DTO.cancelAnOrder(itemID));
            Response.Output.Write("({0})", serializer.Serialize(result));
        }
    }
}